package com.soft.cake.pojo;

import org.springframework.stereotype.Repository;

@Repository
public class Cart {
	
    private Integer cartId;
    private Product product;
    private User user;
    private Integer productQuantity;
    
	/**
	 * Bryan create a Constructor not including cartId to finish 
	 * program more effective
	 * @param product
	 * @param user
	 * @param productQuantity
	 */
    public Cart() {
		super();
	}
	public Cart(Product product, User user, Integer productQuantity) {
		super();
		this.product = product;
		this.user = user;
		this.productQuantity = productQuantity;
	}

	

	public Integer getProductID() {
    	return product.getProductId();
    }
    
    public Integer getUserID() {
    	return user.getUserId();
    }
       
    public Integer getCartId() {
        return cartId;
    }

    public void setCartId(Integer cartId) {
        this.cartId = cartId;
    }

    public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Integer getProductQuantity() {
        return productQuantity;
    }

    public void setProductQuantity(Integer productQuantity) {
        this.productQuantity = productQuantity;
    }

	@Override
	public String toString() {
		return "Cart [cartId=" + cartId + ", product=" + product + ", user=" + user + ", productQuantity="
				+ productQuantity + "]";
	}
    
}